package com.crm.system.service.impl.cluePoolManager;

import com.crm.common.model.DhPageInfo;
import com.crm.model.vo.cluePoolManager.ClueFollowVO;
import com.crm.model.vo.cluePoolManager.ClueVisitRecordVO;
import com.crm.service.cluePoolManager.ClueVisitRecordDbService;
import com.crm.system.service.cluePoolManager.ClueVisitRecordService;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @ Author ：wll
 */
@Service
public class ClueVisitRecordServiceImpl implements ClueVisitRecordService {
    @Autowired
    private ClueVisitRecordDbService clueVisitRecordDbService;
    /**
     * @author wll
     * info 拜访记录
     */
    @Override
    public DhPageInfo<ClueVisitRecordVO> selectClueVisitRecords(Integer pageIndex, Integer pageSize, String clueId) {
        if(pageIndex!=null&&pageSize!=null) {
            PageHelper.startPage(pageIndex, pageSize);
        }
        List<ClueVisitRecordVO> clueVisitRecordVOList = clueVisitRecordDbService.selectClueVisitRecordVOList(clueId);
        PageInfo<ClueVisitRecordVO> pageInfo = new PageInfo<ClueVisitRecordVO>(clueVisitRecordVOList);
        return new DhPageInfo<ClueVisitRecordVO>(pageInfo, clueVisitRecordVOList);
    }
}
